From 4766f8b843d2586fcdd1b967577d548e1c9d19f1 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 8 Apr 2015 17:05:24 +0100 Subject: [PATCH] libxl: check return value of libxl_vcpu_setaffinity That function can fail. Signed-off-by: Wei Liu Cc: Ian Campbell Cc: Ian Jackson Cc: Dario Faggioli Reviewed-by: Dario Faggioli Acked-by: Ian Jackson Acked-by: Ian Campbell --- tools/libxl/libxl_dom.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 9711fb647d..f408646ea0 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -468,8 +468,13 @@ static int set_vnuma_affinity(libxl__gc *gc, uint32_t domid, goto out; } - libxl_for_each_set_bit(j, v->vcpus) - libxl_set_vcpuaffinity(CTX, domid, j, NULL, &cpumap); + libxl_for_each_set_bit(j, v->vcpus) { + rc = libxl_set_vcpuaffinity(CTX, domid, j, NULL, &cpumap); + if (rc) { + LOG(ERROR, "Can't set cpu affinity for %d", j); + goto out; + } + } } out: -- 2.30.2